﻿<?php
	include 'inc/conn.php';

	extract($_POST);
	extract($_GET);
	unset($_POST,$_GET);

	if (!isset($id))
	{
		echo "<script>alert('ID is empty!');</script>";
		die("ID is empty!");
	}
	$db = new mysql();
	$sql = "select * from te_wiki_table where id=".$id;
	$db->query($sql);
	$num = $db->db_num_rows();
	if ($num == 0)
		die("No data was found!");
	$row = $db->fetch_assoc();
?>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- <link rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/css/bootstrap.min.css">-->
<link rel="stylesheet" href="/css/bootstrap.min.css">
<script type="text/javascript" src="/js/jquery.min.js"></script>
<script type="text/javascript" src="/js/jquery-migrate.min.js"></script>
<script type="text/javascript" src="/xhEditor/xheditor.min.js"></script>
<script type="text/javascript" src="/xhEditor/xheditor_lang/zh-cn.js"></script>
<script type="text/javascript" src="/js/bootstrap.min.js"></script>
<title>查看 "<? echo htmlspecialchars_decode($row['wiki_title']); ?>" 详细信息</title>
<script type="text/javascript">  
function goTopEx() {  
    var obj = document.getElementById("goTopBtn");  
    function getScrollTop() {  
        return document.documentElement.scrollTop + document.body.scrollTop;  
    }  
    function setScrollTop(value) {  
        if (document.documentElement.scrollTop) {  
            document.documentElement.scrollTop = value;  
        } else {  
            document.body.scrollTop = value;  
        }  
    }  
    window.onscroll = function() {  
        getScrollTop() > 0 ? obj.style.display = "": obj.style.display = "none";  
    }  
    obj.onclick = function() {  
        var goTop = setInterval(scrollMove, 10);  
        function scrollMove() {  
            setScrollTop(getScrollTop() / 1.1);  
            if (getScrollTop() < 1) clearInterval(goTop);  
        }  
    }  
}  
</script>  
<style>
	BODY {  
		HEIGHT: auto;  
	}  
	#goTopBtn {  
		POSITION: fixed; TEXT-ALIGN: center; LINE-HEIGHT: 30px; WIDTH: 30px; BOTTOM: 35px; 
		HEIGHT: 33px; FONT-SIZE: 12px; CURSOR: pointer; RIGHT: 0px; _position: absolute; _right: auto  
	}  
</style>

</head>
<body class="background">
<div style="display: none" id="goTopBtn"><img border=0 src="/image/top.jpg"></div>
<script type=text/javascript>goTopEx();</script>
<?
	include "top.php";
?>
<div class="container-fluid white-background pagecontent">
<div class="panel panel-primary">
    <div class="panel-heading">
        <h3 class="panel-title">
		维基内容>>查看 "<? echo htmlspecialchars_decode($row['wiki_title']); ?>" 详细信息
		<? 
			if (isset($_SESSION['ID']) && $_SESSION['logchnname'] == $row['wiki_writor']) {
				echo "<a href='#' rel='tooltip' title='修改' onclick=\"javascript:window.open('/admin/mod_wiki.php?id=${id}', '修改', 'height=860, width=1200, toolbar=no, menubar=no, scrollbars=yes, resizable=yes,location=no, status=no');\">[编辑]</a>";
			}
		?>
		</h3>
    </div>
    <div class="panel-body">
	<p>
	<strong>标题:</strong>&nbsp;<? echo htmlspecialchars_decode($row['wiki_title']); ?><br />
	</p>
	<p>
	<strong>作者:</strong>&nbsp;<? echo htmlspecialchars_decode($row['wiki_writor']); ?>&nbsp;&nbsp;&nbsp;&nbsp;<strong>日期:</strong>&nbsp;<? echo htmlspecialchars_decode($row['wiki_build_date']); ?><br />
	</p>
	<p class="text-info">详细内容：</p>
	<? echo htmlspecialchars_decode($row['wiki_body']); ?>
	</div>
</div>
</div>
<?
include 'bottom.php';
?>
</body>
</html>
<?
	$db->close();
?>
